package com.boot2.core.web;

import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;

/**
* @author zhangweilin
* @date 2020/6/12 17:31
* @Description:
*/
@Component
public class PortalTomcatWebServerCustomizer implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {

    @Override
    public void customize(TomcatServletWebServerFactory factory) {
        //解决The valid characters are defined in RFC 7230 and RFC 3986
        factory.addConnectorCustomizers(connector -> connector.setProperty("relaxedQueryChars", "{}[]|"));
    }
}